<template>
  <div>

    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>IPA</el-breadcrumb-item>
      <el-breadcrumb-item>关联用户列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>关联账户列表</span>
        <el-button style="float: right; padding: 3px 0" type="text" @click="add_account">添加</el-button>
      </div>
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
          prop="name"
          label="名称"
        >
        </el-table-column>
        <el-table-column
          prop="account"
          label="账号"
        >
        </el-table-column>
        <el-table-column
          prop="teamid"
          label="团队id">
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button
              size="mini"
              @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
            <el-button
              size="mini"
              type="danger"
              @click="handleDelete(scope.$index, scope.row)">删除</el-button>
          </template>
        </el-table-column>

      </el-table>
    </el-card>

  </div>


</template>

<script>
  export default {
    name: "Associated",
    data() {
      return {
        tableData: [{
          name: '项目1',
          account: '12345',
          teamid: '1111111',
          operations: '不知道'
        }, {
          name: '项目2',
          account: '12345',
          teamid: '1111111',
          operations: '不知道'
        }, {
          name: '项目3',
          account: '12345',
          teamid: '1111111',
          operations: '不知道'
        }, {
          name: '项目4',
          account: '12345',
          teamid: '1111111',
          operations: '不知道'
        }]
      }
    },
    methods: {
      add_account() {

      },
      handleEdit(index, row) {
        this.$router.push({
          name:'AddAccount',
          path:'/addAccount',
          params:{
            object:row
          }
        }

      )
        console.log(index, row);
      },
      handleDelete(index, row) {
        // console.log(index, row.name);
      }
    }
  }
</script>

<style scoped>
  .box-card {
    margin-top: 20px;
  }

  .text {
    font-size: 14px;
  }

  .item {
    margin-bottom: 18px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }


</style>
